"""
@作者 = "陈诗"
@email = 3168157154@qq.com
@creative_time = 2025/11/13 18:52
"""
import numpy as np
# 创建ndarray对象
x = np.array([1, 2, 3])
y = np.array((4, 5, 6))
z = np.array([[1, 2, 3], (4, 5, 6)])

print(x, y, z, sep="\n")
print(x)
print(z.shape)  # 行,列

# 单位矩阵(左上到右下的对角线是1其他都是0)
print(np.eye(4, k=1))  # k使对角线上/下移动n行

# .arange(start, stop, step, dtype)函数---更强大的range
arr1 = np.arange(5)  # 从零开始 步长1
print(arr1)
arr2 = np.arange(1, 10, 2)
print(arr2)

print(np.ones(3))
